﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamPaperUpdate.aspx.cs" Inherits="Web.ExamPaperUpdate" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>主略策维护</title>
    <link href="css/minicss.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="js/jsdatepicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
    function CheckNumber(str)
    {
        if(/^\d+$/.test(str))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    function Save()
    {
            var name = window.document.forms["form1"]["tbName"].value;
            if(name==null || name=="")
            {
                alert("请输入名称！");
                return false;
            }
            var allScore = window.document.forms["form1"]["tbScore"].value;
            if(allScore==null || allScore=="")
            {
               alert("请输入总分！"); 
               return false;
            }
            else
            {
                if(!CheckNumber(allScore))
                {
                    alert("请输入数字！"); 
                    return false;
                }
            }
            if(window.document.forms["form1"]["drpSubject"].selectedIndex==-1)
            {
                 alert("请选择科目！");
                 return;
            }
            var order = window.document.forms["form1"]["tbTimeLong"].value;
            if(order==null || order=="")
            {
               alert("请输入时长！"); 
               return false;
            }
            else
            {
                if(!CheckNumber(order))
                {
                    alert("请输入数字！"); 
                    return false;
                }
            }   
            if(window.document.getElementById("drpPolicy").selectedIndex==-1)
            {
                alert("请选择策略！"); 
                return false;
            }       
            return true;
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id='block'>
        <div id='blockcontent' align="center">
            <br />
            <div class="formdiv">
                <table>
                    <tr align="left" valign="top" style="height:20px;">
                        <td>名称：</td>
                        <td><asp:TextBox ID="tbName" runat="server" Width="260px"></asp:TextBox></td>
                         <td>科目：</td>
                        <td>
                            <asp:DropDownList ID="drpSubject" runat="server" Width="268px" 
                                AutoPostBack="True" onselectedindexchanged="drpSubject_SelectedIndexChanged1" >
                            </asp:DropDownList>
                        </td>
                        
                    </tr>
                     <tr align="left" valign="top" style="height:20px;">
                        <td>时长：</td>
                        <td><asp:TextBox ID="tbTimeLong"  Width="260px" Text="90" runat="server"></asp:TextBox></td>
                        <td>总分：</td>
                        <td><asp:TextBox ID="tbScore" runat="server" Text="100" Width="260px"></asp:TextBox></td>
                    </tr>
                     <tr align="left" valign="top" style="height:20px;">
                        <td>组卷策略：</td>
                        <td>
                            <asp:DropDownList ID="drpPolicy" runat="server" Width="268px"></asp:DropDownList>
                        </td>
                         <td></td>    
                        <td></td>    
                    
                    </tr>
                    <tr align="left" valign="top" style="height:20px;">
                        <td>已经使用：</td>    
                        <td>
                            <asp:DropDownList ID="drpUse" runat="server" Width="268px">
                                <asp:ListItem Value="0">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </td>  
                        <td>使用时间：</td>    
                        <td>
                            <asp:TextBox ID="tbExamTime" Width="260px" runat="server"></asp:TextBox>
                        </td>           
                    </tr>
                </table>
                
            </div>
        </div>
        <div id='blockfloor'>
            <asp:Button ID="Button1" runat="server" Text="保存" OnClick="Button1_Click"  OnClientClick="return Save();"
                Width="100px" />
        </div>
    </div>
    </form>
</body>
</html>
